﻿using System.Threading.Tasks;
using EurekaService.Business;
using Microsoft.AspNetCore.Mvc;

namespace EurekaService.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
//      private  readonly DiscoveryHttpClientHandler _handler;
//        public ValuesController( IDiscoveryClient handler)
//        {
//            _handler = new DiscoveryHttpClientHandler(handler); ;
//        }
//        private HttpClient GetClient()
//        {
//            var client = new HttpClient(_handler, false);
//            return client;
//        }


        private readonly IService _service;

        public ValuesController(IService service)
        {
            _service = service;
        }

        [HttpGet("product")]
        public async Task<string> GoProductAsync()
        {
//            var client = GetClient();
            return await _service.GetValue("");
        }
        private const string ProductUrl = "http://product/api/values";
        
    }
}
